//
// Created by 45512 on 2021/11/17.
//
#include <iostream>
using namespace std;

int main(){
    int n;
    cin>> n;
    int list[n][2];
    int count =0;
    for (int i=0;i<n;++i){
        cin>>list[i][0]>>list[i][1];
        count += list[i][0]*list[i][1];
    }
    if (count>0) cout << count << endl;
    else cout << 0 << endl;
    return 0;
}

